﻿

#region Using directives

using System;
using System.Configuration.Provider;
using System.Collections.Specialized;
using System.Data;
using System.Data.Common;
using InfoExpress.HIV.Domains;
using InfoExpress.HIV.DataAccess.Bases;

#endregion

namespace InfoExpress.HIV.DataAccess.WebServiceClient
{
	/// <summary>
	/// The WebService client data provider.
	/// </summary>
	public sealed class WsNetTiersProvider : InfoExpress.HIV.DataAccess.Bases.NetTiersProvider
	{
		private static object syncRoot = new Object();
		private string _applicationName;
		private string url;
        
		/// <summary>
		/// Initializes a new instance of the <see cref="WsNetTiersProvider"/> class.
		///</summary>
		public WsNetTiersProvider()
		{			
		}
		
		/// <summary>
        /// Initializes the provider.
        /// </summary>
        /// <param name="name">The friendly name of the provider.</param>
        /// <param name="config">A collection of the name/value pairs representing the provider-specific attributes specified in the configuration for this provider.</param>
        /// <exception cref="T:System.ArgumentNullException">The name of the provider is null.</exception>
        /// <exception cref="T:System.InvalidOperationException">An attempt is made to call <see cref="M:System.Configuration.Provider.ProviderBase.Initialize(System.String,System.Collections.Specialized.NameValueCollection)"></see> on a provider after the provider has already been initialized.</exception>
        /// <exception cref="T:System.ArgumentException">The name of the provider has a length of zero.</exception>
		public override void Initialize(string name, NameValueCollection config)
        {
            // Verify that config isn't null
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            // Assign the provider a default name if it doesn't have one
            if (String.IsNullOrEmpty(name))
            {
                name = "SqlNetTiersProvider";
            }

            // Add a default "description" attribute to config if the
            // attribute doesn't exist or is empty
            if (string.IsNullOrEmpty(config["description"]))
            {
                config.Remove("description");
                config.Add("description", "NetTiers Sql provider");
            }

            // Call the base class's Initialize method
            base.Initialize(name, config);

            // Initialize _applicationName
            _applicationName = config["applicationName"];

            if (string.IsNullOrEmpty(_applicationName))
            {
                _applicationName = "/";
            }
            config.Remove("applicationName");


            #region Initialize Url
            string url  = config["url"];
           	if (string.IsNullOrEmpty(url))
            {
                throw new ProviderException("Empty or missing url");
            }
            this.url = url;
            config.Remove("url");
            #endregion

        }
        
		/// <summary>
		/// Current Url for WebService EndPoint
		/// </summary>
        public string Url
        {
        	get {return this.url;}
        	set {this.url = value;}
        }
		
		/// <summary>
		/// Creates a new <c cref="TransactionManager"/> instance from the current datasource.
		/// </summary>
		/// <returns></returns>
		public override TransactionManager CreateTransaction()
		{
			throw new NotSupportedException("Transactions are not supported by the webservice client.");
		}
		
		///<summary>
		/// Indicates if the current <c cref="NetTiersProvider"/> implementation supports Transacton.
		///</summary>
		public override bool IsTransactionSupported
		{
			get
			{
				return false;
			}
		}

			
		private WsTrangThaiProvider innerTrangThaiProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="TrangThai"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override TrangThaiProviderBase TrangThaiProvider
		{
			get
			{
				if (innerTrangThaiProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerTrangThaiProvider == null)
						{
							this.innerTrangThaiProvider = new WsTrangThaiProvider(this.url);
						}
					}
				}
				return innerTrangThaiProvider;
			}
		}
		
			
		private WsBenhNhanDangKyProvider innerBenhNhanDangKyProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="BenhNhanDangKy"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override BenhNhanDangKyProviderBase BenhNhanDangKyProvider
		{
			get
			{
				if (innerBenhNhanDangKyProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerBenhNhanDangKyProvider == null)
						{
							this.innerBenhNhanDangKyProvider = new WsBenhNhanDangKyProvider(this.url);
						}
					}
				}
				return innerBenhNhanDangKyProvider;
			}
		}
		
			
		private WsSUsersProvider innerSUsersProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="SUsers"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override SUsersProviderBase SUsersProvider
		{
			get
			{
				if (innerSUsersProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerSUsersProvider == null)
						{
							this.innerSUsersProvider = new WsSUsersProvider(this.url);
						}
					}
				}
				return innerSUsersProvider;
			}
		}
		
			
		private WsThayDoiPhacDoProvider innerThayDoiPhacDoProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="ThayDoiPhacDo"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override ThayDoiPhacDoProviderBase ThayDoiPhacDoProvider
		{
			get
			{
				if (innerThayDoiPhacDoProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerThayDoiPhacDoProvider == null)
						{
							this.innerThayDoiPhacDoProvider = new WsThayDoiPhacDoProvider(this.url);
						}
					}
				}
				return innerThayDoiPhacDoProvider;
			}
		}
		
			
		private WsThayDoiDieuTriProvider innerThayDoiDieuTriProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="ThayDoiDieuTri"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override ThayDoiDieuTriProviderBase ThayDoiDieuTriProvider
		{
			get
			{
				if (innerThayDoiDieuTriProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerThayDoiDieuTriProvider == null)
						{
							this.innerThayDoiDieuTriProvider = new WsThayDoiDieuTriProvider(this.url);
						}
					}
				}
				return innerThayDoiDieuTriProvider;
			}
		}
		
			
		private WsUtPhacdoProvider innerUtPhacdoProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="UtPhacdo"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override UtPhacdoProviderBase UtPhacdoProvider
		{
			get
			{
				if (innerUtPhacdoProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerUtPhacdoProvider == null)
						{
							this.innerUtPhacdoProvider = new WsUtPhacdoProvider(this.url);
						}
					}
				}
				return innerUtPhacdoProvider;
			}
		}
		
			
		private WsUtDmdvProvider innerUtDmdvProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="UtDmdv"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override UtDmdvProviderBase UtDmdvProvider
		{
			get
			{
				if (innerUtDmdvProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerUtDmdvProvider == null)
						{
							this.innerUtDmdvProvider = new WsUtDmdvProvider(this.url);
						}
					}
				}
				return innerUtDmdvProvider;
			}
		}
		
			
		private WsUtDmxnProvider innerUtDmxnProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="UtDmxn"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override UtDmxnProviderBase UtDmxnProvider
		{
			get
			{
				if (innerUtDmxnProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerUtDmxnProvider == null)
						{
							this.innerUtDmxnProvider = new WsUtDmxnProvider(this.url);
						}
					}
				}
				return innerUtDmxnProvider;
			}
		}
		
			
		private WsPhanLoaiBenhNhanProvider innerPhanLoaiBenhNhanProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="PhanLoaiBenhNhan"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override PhanLoaiBenhNhanProviderBase PhanLoaiBenhNhanProvider
		{
			get
			{
				if (innerPhanLoaiBenhNhanProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerPhanLoaiBenhNhanProvider == null)
						{
							this.innerPhanLoaiBenhNhanProvider = new WsPhanLoaiBenhNhanProvider(this.url);
						}
					}
				}
				return innerPhanLoaiBenhNhanProvider;
			}
		}
		
			
		private WsUtDmuserProvider innerUtDmuserProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="UtDmuser"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override UtDmuserProviderBase UtDmuserProvider
		{
			get
			{
				if (innerUtDmuserProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerUtDmuserProvider == null)
						{
							this.innerUtDmuserProvider = new WsUtDmuserProvider(this.url);
						}
					}
				}
				return innerUtDmuserProvider;
			}
		}
		
			
		private WsLoaiProvider innerLoaiProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="Loai"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override LoaiProviderBase LoaiProvider
		{
			get
			{
				if (innerLoaiProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerLoaiProvider == null)
						{
							this.innerLoaiProvider = new WsLoaiProvider(this.url);
						}
					}
				}
				return innerLoaiProvider;
			}
		}
		
			
		private WsPdmqhProvider innerPdmqhProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="Pdmqh"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override PdmqhProviderBase PdmqhProvider
		{
			get
			{
				if (innerPdmqhProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerPdmqhProvider == null)
						{
							this.innerPdmqhProvider = new WsPdmqhProvider(this.url);
						}
					}
				}
				return innerPdmqhProvider;
			}
		}
		
			
		private WsLichSuDieuTriProvider innerLichSuDieuTriProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="LichSuDieuTri"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override LichSuDieuTriProviderBase LichSuDieuTriProvider
		{
			get
			{
				if (innerLichSuDieuTriProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerLichSuDieuTriProvider == null)
						{
							this.innerLichSuDieuTriProvider = new WsLichSuDieuTriProvider(this.url);
						}
					}
				}
				return innerLichSuDieuTriProvider;
			}
		}
		
			
		private WsChuyenOpcBufferProvider innerChuyenOpcBufferProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="ChuyenOpcBuffer"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override ChuyenOpcBufferProviderBase ChuyenOpcBufferProvider
		{
			get
			{
				if (innerChuyenOpcBufferProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerChuyenOpcBufferProvider == null)
						{
							this.innerChuyenOpcBufferProvider = new WsChuyenOpcBufferProvider(this.url);
						}
					}
				}
				return innerChuyenOpcBufferProvider;
			}
		}
		
			
		private WsDieuTriProvider innerDieuTriProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="DieuTri"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override DieuTriProviderBase DieuTriProvider
		{
			get
			{
				if (innerDieuTriProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerDieuTriProvider == null)
						{
							this.innerDieuTriProvider = new WsDieuTriProvider(this.url);
						}
					}
				}
				return innerDieuTriProvider;
			}
		}
		
			
		private WsPdmphxaProvider innerPdmphxaProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="Pdmphxa"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override PdmphxaProviderBase PdmphxaProvider
		{
			get
			{
				if (innerPdmphxaProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerPdmphxaProvider == null)
						{
							this.innerPdmphxaProvider = new WsPdmphxaProvider(this.url);
						}
					}
				}
				return innerPdmphxaProvider;
			}
		}
		
			
		private WsPdmdtProvider innerPdmdtProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="Pdmdt"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override PdmdtProviderBase PdmdtProvider
		{
			get
			{
				if (innerPdmdtProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerPdmdtProvider == null)
						{
							this.innerPdmdtProvider = new WsPdmdtProvider(this.url);
						}
					}
				}
				return innerPdmdtProvider;
			}
		}
		
			
		private WsPdmnnProvider innerPdmnnProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="Pdmnn"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override PdmnnProviderBase PdmnnProvider
		{
			get
			{
				if (innerPdmnnProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerPdmnnProvider == null)
						{
							this.innerPdmnnProvider = new WsPdmnnProvider(this.url);
						}
					}
				}
				return innerPdmnnProvider;
			}
		}
		
			
		private WsUtTinhProvider innerUtTinhProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="UtTinh"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override UtTinhProviderBase UtTinhProvider
		{
			get
			{
				if (innerUtTinhProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerUtTinhProvider == null)
						{
							this.innerUtTinhProvider = new WsUtTinhProvider(this.url);
						}
					}
				}
				return innerUtTinhProvider;
			}
		}
		
			
		private WsPdmnclnProvider innerPdmnclnProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="Pdmncln"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override PdmnclnProviderBase PdmnclnProvider
		{
			get
			{
				if (innerPdmnclnProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerPdmnclnProvider == null)
						{
							this.innerPdmnclnProvider = new WsPdmnclnProvider(this.url);
						}
					}
				}
				return innerPdmnclnProvider;
			}
		}
		
		
		
		#region "General data access methods"

		#region "ExecuteNonQuery"
		/// <summary>
		/// Executes the non query.
		/// </summary>
		/// <param name="storedProcedureName">Name of the stored procedure.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <returns></returns>
		public override int ExecuteNonQuery(string storedProcedureName, params object[] parameterValues)
		{
			WsProxy.HIVServices proxy = new WsProxy.HIVServices();
			proxy.Url = this.url;
			return proxy.ExecuteNonQuery(storedProcedureName, parameterValues);
		}

		/// <summary>
		/// Executes the non query.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="storedProcedureName">Name of the stored procedure.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <returns></returns>
		public override int ExecuteNonQuery(TransactionManager transactionManager, string storedProcedureName, params object[] parameterValues)
		{
			throw new NotSupportedException("TransactionManager overloads are not supported by the WebService provider.");
		}

		/// <summary>
		/// Executes the non query.
		/// </summary>
		/// <param name="commandWrapper">The command wrapper.</param>
		public override void ExecuteNonQuery(DbCommand commandWrapper)
		{
			throw new NotSupportedException("DBCommandWrapper overloads are not supported by the WebService provider.");
		}

		/// <summary>
		/// Executes the non query.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="commandWrapper">The command wrapper.</param>
		public override void ExecuteNonQuery(TransactionManager transactionManager, DbCommand commandWrapper)
		{
			throw new NotSupportedException("DBCommandWrapper overloads are not supported by the WebService provider.");
		}


		/// <summary>
		/// Executes the non query.
		/// </summary>
		/// <param name="commandType">Type of the command.</param>
		/// <param name="commandText">The command text.</param>
		/// <returns></returns>
		public override int ExecuteNonQuery(CommandType commandType, string commandText)
		{
			WsProxy.HIVServices proxy = new WsProxy.HIVServices();
			proxy.Url = this.url;
			return proxy.ExecuteNonQuery((WsProxy.CommandType)Enum.Parse(typeof(WsProxy.CommandType), commandType.ToString(), false), commandText);
		}
		/// <summary>
		/// Executes the non query.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="commandType">Type of the command.</param>
		/// <param name="commandText">The command text.</param>
		/// <returns></returns>
		public override int ExecuteNonQuery(TransactionManager transactionManager, CommandType commandType, string commandText)
		{
			throw new NotSupportedException("TransactionManager overloads are not supported by the WebService provider.");
		}
		#endregion

		#region "ExecuteDataReader"
		/// <summary>
		/// Executes the reader.
		/// </summary>
		/// <param name="storedProcedureName">Name of the stored procedure.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <returns></returns>
		public override IDataReader ExecuteReader(string storedProcedureName, params object[] parameterValues)
		{
			throw new NotSupportedException("ExecuteReader methods are not supported by the WebService provider.");
		}

		/// <summary>
		/// Executes the reader.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="storedProcedureName">Name of the stored procedure.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <returns></returns>
		public override IDataReader ExecuteReader(TransactionManager transactionManager, string storedProcedureName, params object[] parameterValues)
		{
			throw new NotSupportedException("ExecuteReader methods are not supported by the WebService provider.");
		}

		/// <summary>
		/// Executes the reader.
		/// </summary>
		/// <param name="commandWrapper">The command wrapper.</param>
		/// <returns></returns>
		public override IDataReader ExecuteReader(DbCommand commandWrapper)
		{
			throw new NotSupportedException("ExecuteReader methods are not supported by the WebService provider.");
		}

		/// <summary>
		/// Executes the reader.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="commandWrapper">The command wrapper.</param>
		/// <returns></returns>
		public override IDataReader ExecuteReader(TransactionManager transactionManager, DbCommand commandWrapper)
		{
			throw new NotSupportedException("ExecuteReader methods are not supported by the WebService provider.");
		}


		/// <summary>
		/// Executes the reader.
		/// </summary>
		/// <param name="commandType">Type of the command.</param>
		/// <param name="commandText">The command text.</param>
		/// <returns></returns>
		public override IDataReader ExecuteReader(CommandType commandType, string commandText)
		{
			throw new NotSupportedException("ExecuteReader methods are not supported by the WebService provider.");
		}
		/// <summary>
		/// Executes the reader.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="commandType">Type of the command.</param>
		/// <param name="commandText">The command text.</param>
		/// <returns></returns>
		public override IDataReader ExecuteReader(TransactionManager transactionManager, CommandType commandType, string commandText)
		{
			throw new NotSupportedException("ExecuteReader methods are not supported by the WebService provider.");
		}
		#endregion

		#region "ExecuteDataSet"
		/// <summary>
		/// Executes the data set.
		/// </summary>
		/// <param name="storedProcedureName">Name of the stored procedure.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <returns></returns>
		public override DataSet ExecuteDataSet(string storedProcedureName, params object[] parameterValues)
		{
			WsProxy.HIVServices proxy = new WsProxy.HIVServices();
			proxy.Url = this.url;
			return proxy.ExecuteDataSet(storedProcedureName, parameterValues);
		}

		/// <summary>
		/// Executes the data set.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="storedProcedureName">Name of the stored procedure.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <returns></returns>
		public override DataSet ExecuteDataSet(TransactionManager transactionManager, string storedProcedureName, params object[] parameterValues)
		{
			throw new NotSupportedException("TransactionManager overloads are not supported by the WebService provider.");
		}

		/// <summary>
		/// Executes the data set.
		/// </summary>
		/// <param name="commandWrapper">The command wrapper.</param>
		/// <returns></returns>
		public override DataSet ExecuteDataSet(DbCommand commandWrapper)
		{
			throw new NotSupportedException("DBCommandWrapper overloads are not supported by the WebService provider.");
		}

		/// <summary>
		/// Executes the data set.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="commandWrapper">The command wrapper.</param>
		/// <returns></returns>
		public override DataSet ExecuteDataSet(TransactionManager transactionManager, DbCommand commandWrapper)
		{
			throw new NotSupportedException("DBCommandWrapper overloads are not supported by the WebService provider.");
		}


		/// <summary>
		/// Executes the data set.
		/// </summary>
		/// <param name="commandType">Type of the command.</param>
		/// <param name="commandText">The command text.</param>
		/// <returns></returns>
		public override DataSet ExecuteDataSet(CommandType commandType, string commandText)
		{
			WsProxy.HIVServices proxy = new WsProxy.HIVServices();
			proxy.Url = this.url;
			return proxy.ExecuteDataSet((WsProxy.CommandType)Enum.Parse(typeof(WsProxy.CommandType), commandType.ToString(), false), commandText);
		}
		
		/// <summary>
		/// Executes the data set.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="commandType">Type of the command.</param>
		/// <param name="commandText">The command text.</param>
		/// <returns></returns>
		public override DataSet ExecuteDataSet(TransactionManager transactionManager, CommandType commandType, string commandText)
		{
			throw new NotSupportedException("TransactionManager overloads are not supported by the WebService provider.");			
		}
		#endregion

		#region "ExecuteScalar"
		/// <summary>
		/// Executes the scalar.
		/// </summary>
		/// <param name="storedProcedureName">Name of the stored procedure.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <returns></returns>
		public override object ExecuteScalar(string storedProcedureName, params object[] parameterValues)
		{
			WsProxy.HIVServices proxy = new WsProxy.HIVServices();
			proxy.Url = this.url;
			return proxy.ExecuteScalar(storedProcedureName, parameterValues);
		}

		/// <summary>
		/// Executes the scalar.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="storedProcedureName">Name of the stored procedure.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <returns></returns>
		public override object ExecuteScalar(TransactionManager transactionManager, string storedProcedureName, params object[] parameterValues)
		{
			throw new NotSupportedException("TransactionManager overloads are not supported by the WebService provider.");
		}

		/// <summary>
		/// Executes the scalar.
		/// </summary>
		/// <param name="commandWrapper">The command wrapper.</param>
		/// <returns></returns>
		public override object ExecuteScalar(DbCommand commandWrapper)
		{
			throw new NotSupportedException("DBCommandWrapper overloads are not supported by the WebService provider.");
		}

		/// <summary>
		/// Executes the scalar.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="commandWrapper">The command wrapper.</param>
		/// <returns></returns>
		public override object ExecuteScalar(TransactionManager transactionManager, DbCommand commandWrapper)
		{
			throw new NotSupportedException("DBCommandWrapper overloads are not supported by the WebService provider.");
		}

		/// <summary>
		/// Executes the scalar.
		/// </summary>
		/// <param name="commandType">Type of the command.</param>
		/// <param name="commandText">The command text.</param>
		/// <returns></returns>
		public override object ExecuteScalar(CommandType commandType, string commandText)
		{
			WsProxy.HIVServices proxy = new WsProxy.HIVServices();
			proxy.Url = this.url;
			return proxy.ExecuteScalar((WsProxy.CommandType)Enum.Parse(typeof(WsProxy.CommandType), commandType.ToString(), false), commandText);	
		}
		/// <summary>
		/// Executes the scalar.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="commandType">Type of the command.</param>
		/// <param name="commandText">The command text.</param>
		/// <returns></returns>
		public override object ExecuteScalar(TransactionManager transactionManager, CommandType commandType, string commandText)
		{
			throw new NotSupportedException("TransactionManager overloads are not supported by the WebService provider.");		
		}
		#endregion

		#endregion
	}
}
